﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using Utilities.QuickSql;
using MySql.Data;

namespace Deviseur_Cs2i_Car
{
    class CATEGOPTION
    {

        int NumCategOption;
        string LibelleCategOption;

        public CATEGOPTION() { }

        public CATEGOPTION(string LibelleCategOption)
        {
            this.LibelleCategOption = LibelleCategOption;
        }
        public CATEGOPTION(int NumCategOption)
        {
            this.NumCategOption = NumCategOption;
        }
        public CATEGOPTION(int NumCategOption, string LibelleCategOption)
        {
            this.NumCategOption = NumCategOption;
            this.LibelleCategOption = LibelleCategOption;
        }

        public int get_NumCategOption()
        {
            return this.NumCategOption;
        }
        public string get_LibelleCategOption()
        {
            return this.LibelleCategOption;
        }

        public void set_NumCategOption(int NumCategOption)
        {
            this.NumCategOption = NumCategOption;
        }
        public void set_LibelleCategOption(string LibelleCategOption)
        {
            this.LibelleCategOption = LibelleCategOption;
        }
        public void affiche_CATEGOPTION()
        {
            Console.WriteLine("Num categ option : ", this.NumCategOption);
            Console.WriteLine("libellé categ option : ", this.LibelleCategOption);

        }
        public void new_CategOption()
        {
            Program.Db.Execute("INSERT INTO CATEGOPTION(LibelleCateg) VALUES ('" + this.LibelleCategOption + "')");
        }
        public void modify_CategOption()
        {
            Program.Db.Execute("UPDATE CATEGOPTION SET LibelleCateg = '" + this.LibelleCategOption + "' WHERE NumCateg = " + this.NumCategOption);
        }
        public void delete_CategOption(int NumCategOption)
        {
            Program.Db.Execute("DELETE FROM CATEGOPTION WHERE NumCateg = " + NumCategOption + "");
        }


    }
}
